package com.GUI.Lesson06;
//下拉框

import javax.swing.*;
import java.awt.*;

public class TextCombboxDemo01 extends JFrame {
    public TextCombboxDemo01(){

        Container container = this.getContentPane();
        JComboBox comboBox = new JComboBox();
        comboBox.addItem("多选框");
        comboBox.addItem("1");
        comboBox.addItem("2");
        comboBox.addItem("3");
        comboBox.addItem("4");
        comboBox.addItem("5");

        container.add(comboBox);

        //基本
        this.setVisible(true);
        this.setSize(100,100);
        getContentPane().setBackground(Color.blue);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        new TextCombboxDemo01();
    }
}
